package com.nbjtjc.safe.mapper.edu;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.nbjtjc.safe.bean.Page;
import com.nbjtjc.safe.model.edu.EduRequirementInvestigation;
import com.nbjtjc.util.MyMapper;
@Mapper
public interface EduRequirementInvestigationMapper extends MyMapper<EduRequirementInvestigation> {
	List<EduRequirementInvestigation> search(@Param("eri") EduRequirementInvestigation eduRequirementInvestigation);
	
	List<EduRequirementInvestigation> searchDetail(@Param("eri") EduRequirementInvestigation eduRequirementInvestigation);

	List<EduRequirementInvestigation> managerFindDetail(@Param("eri") EduRequirementInvestigation eduRequirementInvestigation,@Param("parentComIds")List<Integer> parentComIds);

//	@Select("select * from edu_requirement_investigation where id = #{id} and status != 3")
	EduRequirementInvestigation findById(@Param("id") int id);
	
	EduRequirementInvestigation findDetailById(@Param("id") int id);


	@Update("update edu_requirement_investigation set status = 3 where id = #{id}")
	int cancelByPrimaryKey(@Param("id") Integer id);
	
    @Select("SELECT DISTINCT DATE_FORMAT(create_year,'%Y') AS 'year' FROM edu_requirement_investigation where status !=3 and company_id = #{companyId} and create_year is not null")
    List<String> findYear(@Param("companyId") int companyId);

    
    
	List<EduRequirementInvestigation> searchSubcompany(@Param("compId")Integer companyId);

//	List<EduRequirementInvestigation> searchHis(@Param("eri") EduRequirementInvestigation eduRequirementInvestigationSample);
}